package com.xh.petdogexpert.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xh.petdogexpert.base.BaseController;
import com.xh.petdogexpert.base.BaseException;
import com.xh.petdogexpert.base.ResponseData;
import com.xh.petdogexpert.user.dto.Member;
import com.xh.petdogexpert.user.service.IMemberService;

@Controller
public class MemberController extends BaseController {

	@Autowired
	IMemberService memberService;

	@RequestMapping(value = "member/getMember")
	@ResponseBody
	public ResponseData getMember(Integer uid) throws BaseException {

		ResponseData rData = new ResponseData();
		Member rMember = null;

		rMember = memberService.getMember(uid);

		rData.setData(rMember);
		return rData;
	}

	@RequestMapping(value = "member/updateMember")
	@ResponseBody
	public ResponseData updateMember(Member member) throws BaseException {

		ResponseData rData = new ResponseData();

		memberService.updateMember(member);

		rData.setMsg("修改用户成功");

		return rData;
	}

}
